// const __cookieMap: any = {};

const Cookies = {
    set<T>(key: string, val: T) {
		localStorage.setItem(key, JSON.stringify(val));
		// __cookieMap[key] = val;
	},
	// 获取永久缓存
	get(key: string) {
		const str = localStorage.getItem(key);
		return str ? JSON.parse(str) : null;
	},
	// 移除永久缓存
	remove(key: string) {
		localStorage.removeItem(key);
		// __cookieMap[key] = undefined;
	},
	// 移除全部永久缓存
	clear() {
		localStorage.clear();
	},
}

export default Cookies;
